home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v9n04.arc
/
HELLO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-01-30
|
773b
|
52 lines
HELLO.PAS (2 Versions)
PROGRAM Hello;
(* Turbo Pascal 5.5 version *)
TYPE
message = OBJECT
words : String;
CONSTRUCTOR Init(iS : String);
PROCEDURE Say;
END;
CONSTRUCTOR Message.Init(iS : String);
BEGIN words := iS; END;
PROCEDURE Message.Say;
BEGIN WriteLn(words); END;
VAR H : message;
BEGIN
H.Init('OO Hello!');
H.Say;
END.
PROGRAM Hello;
(* QuickPascal version *)
TYPE
message = OBJECT
words : String;
PROCEDURE Init(iS : String);
PROCEDURE Say;
END;
PROCEDURE Message.Init(iS : String);
BEGIN self.words := iS; END;
PROCEDURE Message.Say;
BEGIN WriteLn(self.words); END;
VAR H : message;
BEGIN
New(H);
H.Init('OO Hello!');
H.Say;
END.